<template>
  <div class="title">
<!--    <div class="leftBack">-->
<!--      <van-icon name="arrow-left" size="20" @click="back" />-->
<!--    </div>-->
    <div class="top_title_back" @click="back">
      <i class="iconfont icon-back"></i>
    </div>
    <div class="titleName">{{ title }}</div>
  </div>
</template>

<script>
  export default {
    props: {
      title: {
        type: String,
        default: ''
      },
      backUrl: {
        type: String,
        default: ''
      },
    },
    data() {
      return {

      }
    },
    methods: {
      back() {
        if(this.backUrl==''||this.backUrl==null){
          this.$router.go(-1)
        }else{
          this.$router.push(this.backUrl)
        }
      }
    }
  };
</script>

<style scoped>
  .title {
    height: 50px;
    background: url('~@/assets/images/taskbg.png') no-repeat center;
    font-size: 0.24rem;
    background-size: 100% 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    position: relative;
  }

  .top_title_back {
    position: absolute;
    left: 10px;
    line-height: 50px;
    color: #fff;
  }

  .leftBack {
    position: absolute;
    left: 10px;
    line-height: 50px;
    color: #fff;
  }

  .titleName {
    color: #fff;
    font-weight: bold;
    font-size: 16px;
  }
</style>
